//
//  CityView.m
//  CivilianTravel
//
//  Created by 许仕杰 on 16/7/14.
//  Copyright © 2016年 许仕杰. All rights reserved.
//

#import "CityView.h"

@interface CityView ()

@end

@implementation CityView
//懒加载
- (UIButton *)tureBtn{
    if (!_tureBtn) {
        _tureBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _tureBtn.frame = CGRectMake(0, self.frame.size.height/5*4, self.frame.size.width/2, self.frame.size.height/5);
        [_tureBtn setTitle:@"确定" forState:UIControlStateNormal];
    }
    return _tureBtn;
}

- (UIButton *)cancelBtn{
    if (!_cancelBtn) {
        _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _cancelBtn.frame = CGRectMake(self.frame.size.width/2, self.frame.size.height/5*4, self.frame.size.width/2, self.frame.size.height/5);
        [_cancelBtn setTitle:@"取消" forState:UIControlStateNormal];

    }
    return _cancelBtn;
}

-(UIPickerView *)cityPick{
    if (!_cityPick) {
        _cityPick = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height/5*4)];
    }
    // 显示选中框
//    _cityPick.showsSelectionIndicator=YES;
    return _cityPick;
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.cityPick];
        [self addSubview:self.cancelBtn];
        [self addSubview:self.tureBtn];
    }
    return self;
}




@end
